<template>
  <div class="flex w-full min-h-screen flex-col bg-gray-100">
    <header-cmp></header-cmp>
    <div class="w-full flex-grow">
      类似地图,类似文件目录,类似游戏, 类似相关点
      <pre class="overflow-auto">{{page}}</pre>
    </div>
    <footer-cmp></footer-cmp>
  </div>
</template>

<script>
import HeaderCmp from "@/views/components/HeaderCmp.vue";
import FooterCmp from "@/views/components/FooterCmp.vue";
import {getJson} from "@/assets/http";
import {getChildrenYmlApi} from "@/assets/api";

export default {
  name: "WorldTreePage",
  components: {FooterCmp, HeaderCmp},
  data() {
    return {
      id: this.$route.query.id,
      page: {
        current: 0,
        size: 10,
        records: [],
      },
      search: "",
      defaultProps: {
        children: 'children',
        label: 'ask'
      },
    }
  },
  created() {
    this.init()
  },
  methods: {
    async init(isReload) {
      if (isReload === true) {
        this.page.current = 0
      }
      let params = {ask: this.search, current: this.page.current + 1, size: this.page.size, parentId: 0};
      let res = await getJson(getChildrenYmlApi, params)
      this.page = res.data
    },
  },
}
</script>

<style scoped lang="less">
</style>
